{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "scratchpad",
      "provenance": [],
      "include_colab_link": true
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/ariG23498/NeuralStyleTransfer/blob/master/norm_colab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "iT-MPqNUvtzG",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 146
        },
        "outputId": "e398a6f5-d818-4284-d93e-c7fcfeefcdfb"
      },
      "source": [
        "! git clone https://github.com/mf1024/ImageNet-Datasets-Downloader.git"
      ],
      "execution_count": 1,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Cloning into 'ImageNet-Datasets-Downloader'...\n",
            "remote: Enumerating objects: 4, done.\u001b[K\n",
            "remote: Counting objects: 100% (4/4), done.\u001b[K\n",
            "remote: Compressing objects: 100% (4/4), done.\u001b[K\n",
            "remote: Total 117 (delta 0), reused 1 (delta 0), pack-reused 113\u001b[K\n",
            "Receiving objects: 100% (117/117), 1.57 MiB | 16.26 MiB/s, done.\n",
            "Resolving deltas: 100% (64/64), done.\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "LiqHi1GTvzGW",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 127
        },
        "outputId": "02fcac22-c68f-4e9a-8b68-2005f561fa9b"
      },
      "source": [
        "! wget https://github.com/ariG23498/NeuralStyleTransfer/blob/master/vgg-norm.py"
      ],
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "--2020-08-25 13:14:06--  https://github.com/ariG23498/NeuralStyleTransfer/blob/master/vgg-norm.py\n",
            "Resolving github.com (github.com)... 140.82.113.3\n",
            "Connecting to github.com (github.com)|140.82.113.3|:443... connected.\n",
            "HTTP request sent, awaiting response... 404 Not Found\n",
            "2020-08-25 13:14:07 ERROR 404: Not Found.\n",
            "\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "BBB47nVPwRrs",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "! mkdir /content/ImagNet/"
      ],
      "execution_count": 3,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "y4SkAjoMwzxP",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "! python /content/ImageNet-Datasets-Downloader/downloader.py \\\n",
        "    -data_root /content/ImagNet \\\n",
        "    -number_of_classes 100 \\\n",
        "    -images_per_class 5"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Vc6LOz2hxAR6",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "import os"
      ],
      "execution_count": 6,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Bg6DsSVgyTZO",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 35
        },
        "outputId": "52a01d59-0a7b-4771-f7dc-36ee03d82fca"
      },
      "source": [
        "d = os.listdir('/content/ImagNet/imagenet_images')\n",
        "len(d)"
      ],
      "execution_count": 7,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "98"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 7
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Y55bw-0XyZeZ",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 533
        },
        "outputId": "eb69e7ab-c43c-4ed6-eddb-5e28793cdb5a"
      },
      "source": [
        "! python vgg-norm.py"
      ],
      "execution_count": 11,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "2020-08-25 13:29:17.093638: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1\n",
            "2020-08-25 13:29:18.582388: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcuda.so.1\n",
            "2020-08-25 13:29:18.585520: E tensorflow/stream_executor/cuda/cuda_driver.cc:314] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected\n",
            "2020-08-25 13:29:18.585569: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (f5111013ca30): /proc/driver/nvidia/version does not exist\n",
            "2020-08-25 13:29:18.592274: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 2300000000 Hz\n",
            "2020-08-25 13:29:18.592488: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1856a00 initialized for platform Host (this does not guarantee that XLA will be used). Devices:\n",
            "2020-08-25 13:29:18.592524: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version\n",
            "Found 1070 images belonging to 98 classes.\n",
            "Gathering mean activations...\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x89f2e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 1850064896 bytes == 0xaeb2e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 1850064896 bytes == 0xc732e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x89f2e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 1850064896 bytes == 0xaeb2e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x89f2e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x89f2e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x87a6e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x87a6e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x87a6e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x87a6e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x87a6e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x87a6e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x87a6e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x87a6e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x87a6e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "tcmalloc: large alloc 7398981632 bytes == 0x87a6e000 @  0x7f06573071e7 0x7f062e966e95 0x7f062e97da85 0x7f0634bd66ca 0x7f0634c4ad8a 0x7f0634c4c45b 0x7f0634c4cf0e 0x7f0634cc02d1 0x7f0634cc094c 0x7f0634cc1cdc 0x7f062e7f7939 0x7f062e7bcf8f 0x7f062e7bdbb0 0x7f062e7f18f4 0x7f062e7ba54e 0x7f062e7bc35e 0x7f062e7ad4cd 0x7f062e404418 0x7f062e39fb82 0x7f062889b8c7 0x7f06288beba4 0x50a7f5 0x50c1f4 0x507f24 0x509c50 0x50a64d 0x50cfd6 0x507f24 0x509c50 0x50a64d 0x50cfd6\n",
            "Normalizing mean activations...\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "2lSc3uMpy-FH",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        ""
      ],
      "execution_count": null,
      "outputs": []
    }
  ]
}